<extend name="Public:base" />

<block name="content">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em> 
            {$type}         
            </h3>
        </div>
        
    </div>

    <div class="row margin-botton">
        <div class="col-sm-6 column">
            <div class="btn-group btn-group-md">                
                <button class="btn btn-primary" type="button" onclick="goUrl('{:U('add', array('pid' => $pid))}')"><em class="glyphicon glyphicon-plus-sign"></em> 添加地区</button>
                <button class="btn btn-default" type="button" onclick="doConfirmBatch('{:U('del', array('batchFlag' => 1,'pid' => $pid))}', '确实要删除选择项吗？')"><em class="glyphicon glyphicon-remove-circle"></em> 删除</button>
                <button class="btn btn-default" type="button" onclick="doGoSubmit('{:U('sort', array('pid' => $pid))}','form_do')"><em class="glyphicon glyphicon-th-list"></em> 更新排序</button>
                <if condition="$pid gt 0">
                <button class="btn btn-default" type="button" onclick="goUrl('{:U('index', array('pid' => 0))}')"><em class="glyphicon glyphicon-chevron-left"></em> 返回顶级</button>
                <else/>                
                <button class="btn btn-default" type="button" onclick="goUrl('{:U('createJsArea', array('pid' => 0))}')"><em class="glyphicon glyphicon-plus-sign"></em> 生成JS</button>
                </if>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <form action="" method="post" id="form_do" name="form_do">
                <div class="table-responsive">
                    <table class="table table-hover xyh-table-bordered-out">
                        <thead>
                            <tr class="active">
                                <th><input type="checkbox" id="check"></th>
                                <th>编号</th>
                                <th>名称</th>
                                <th>简称</th>
                                <th>英文名</th>
                                <th>排序</th>
                                <th class="text-right">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name='vlist' item='v'>
                        <tr>
                            <td><input type="checkbox" name="key[]" value="{$v.id}"></td>
                            <td>{$v.id}</td>
                            <td class="aleft"><a href="{:U('Area/index',array('pid' => $v['id']))}">{$v.name}</a></td>
                            <td >{$v.sname}</td>
                            <td>{$v.ename}</td>
                            <td><input type="text" name="sortlist[{$v.id}]" value="{$v.sort}" id="sortlist" size="5" class="xyh-form-control" /></td>
                            <td class="text-right">
                                <a href="{:U('edit',array('id' => $v['id'], 'pid' => $v['pid']))}" class="label label-success">编辑</a>
                                <a href="javascript:;" onclick="toConfirm('{:U('del', array('id' => $v['id'], 'pid' => $v['pid']))}', '确实要删除吗？')" class="label label-danger">删除</a>
                    
                            </td>
                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </form>

            <div class="row clearfix">
                <div class="col-md-12 column">
                    <div class="xyh-page">
                        {$page}
                    </div>
                </div>
            </div>

            
        </div>
    </div>

    </block>